'''
Provides bootstrap for web application and 
maps URLs to response classes

Created on Apr 21, 2011

@author: josh
'''
from google.appengine.ext import webapp
from web import *
from loggerhead import LoggerHead

SLACKLOG_URL = "http://slackware.osuosl.org/slackware64-current/ChangeLog.txt"

if __name__ == "__main__":
    from google.appengine.ext.webapp.util import run_wsgi_app

    # start the main loop
    lh = LoggerHead(SLACKLOG_URL)
    lh.start()
    #print "!!!!"
    
    # create web app from handler       
    app = webapp.WSGIApplication([('/users',NewProfile),
                                  ('/users/list',ListUsers),
                                  ('/users/add',AddProfile),
                                  ('/users/new',NewProfile),
                                  ('/logs/new',NewLog),
                                  ('/logs/add',UpdateLog),
                                  ('/logs/list',ListLogs)
                                  ],debug=True)
    # and run it
    run_wsgi_app(app)